Smart Beta and Portfolio Optimization

Part 1: Smart Beta Portfolio

Criteria Meet Specification

Compute Index Weights

The function generate_dollar_volume_weights computes dollar volume weights.

Compute ETF Weights

The function calculate_dividend_weights computes dividend weights.

Compute Returns

The function generate_returns computes returns.

Compute Weighted Returns

The function generate_weighted_returns computes weighted returns.

Compute Cumulative Returns

The function calculate_cumulative_returns computes cumulative returns.

Compute Tracking Error

The function tracking_error computes tracking error.

Part 2: Portfolio Optimization

Criteria Meet Specification

Compute Covariance

The function get_covariance_returns computes covariance of the returns.

Compute Optimal Weights using Quadratic Programming

The function get_optimal_weights computes optimal weights.

Rebalance Portfolio

The function rebalance_portfolio computes weights for each rebalancing of the portfolio.

Calculate Portfolio Turnover

The function get_portfolio_turnover computes cost of all the rebalancing.